home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1865 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: news.clark.net!usenet
  2. From: gusty@clark.net (Harlan Messinger)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: HELP: syntax calling member fn() of returned object
  5. Date: Sat, 13 Jan 1996 15:27:59 GMT
  6. Organization: Clark Internet Services, Inc.
  7. Message-ID: <4d8j2k$5mc@clarknet.clark.net>
  8. References: <4d3gff$ga4@lib104.its.rpi.edu>
  9. NNTP-Posting-Host: gusty-ppp.clark.net
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; charset=ISO-8859-1
  12. Content-Transfer-Encoding: 8bit
  13. X-Newsreader: Forte Free Agent 1.0.82
  14.  
  15. floydb1@lib104.its.rpi.edu (Barry B Floyd) wrote:
  16.  
  17.  
  18.  
  19. >What is the syntax (if any) for calling a member function
  20. >of a returned object. For example:
  21.  
  22. >// --------------------------------------
  23. >String     MyClass::Function  ( ... )
  24. >{
  25. >    // code
  26. >}
  27.  
  28. >// --------------------------------------
  29. >int     Myclass::AnotherFn ( ... )
  30. >{
  31. >    String a_string ;
  32.  
  33. >    a_string = Function (  ... ) ;
  34.  
  35. >    if ( a_string.length () == 0 )
  36. >        // code
  37. >}
  38. >    
  39. >// --------------------------------------
  40.  
  41. >I would rather not have to do:
  42.  
  43. >    String a_string ;
  44.  
  45. >    a_string = Function (  ... ) ;
  46.  
  47. >I would rather do something like:
  48.  
  49. >    if ( Function (  ... ).length () == 0 )
  50.  
  51. This should work.
  52.  
  53. The 1990s: the Duh Decade
  54.  
  55.